<template>
  <div class="return_point_supplier">
    <c-title :hide="false" :text="plugin_name"></c-title>
    <div class="gridBox">
      <div class="gridBox-item" @click="toGood">
        <i class="iconfont icon-huodongshangpin"></i>
        <div class="txt">活动商品</div>
      </div>
      <div class="gridBox-item" @click="toAudit">
        <i class="iconfont icon-fontclass-daifshouhuo"></i>
        <div class="txt">商品审核</div>
      </div>
      <div class="gridBox-item" @click="toOrder">
        <i class="iconfont icon-kc_mulu"></i>
        <div class="txt">订单管理</div>
      </div>
    </div>
    <div class="pos set-pc-style">
      <div class="btn" @click="toAddGood">新增商品</div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      plugin_name: ""
    };
  },
  activated() {
    let basic_info = window.localStorage.getItem("yz_basic_info");
    let plugin_setting = JSON.parse(basic_info).plugin_setting;
    this.plugin_name = plugin_setting.return_point.plugin_name;
    this.fun.setWXTitle(this.plugin_name);
  },
  methods: {
    toGood() {
      let json = {};
      if (this.$route.name == "return_point_store") {
        json.storeTag = 1;
      }
      this.$router.push(this.fun.getUrl("return_point_activityGood", {}, json));
    },
    toAddGood() {
      let json = {};
      if (this.$route.name == "return_point_store") {
        json.storeTag = 1;
      }
      this.$router.push(this.fun.getUrl("return_point_activityGoodAdd", {}, json));
    },
    toAudit() {
      let json = {};
      if (this.$route.name == "return_point_store") {
        json.storeTag = 1;
      }
      this.$router.push(this.fun.getUrl("return_point_auditGood", {}, json));
    },
    toOrder() {
      if (this.$route.name == "return_point_store") {
        this.$router.push(this.fun.getUrl("orderlist", { status: 0, orderType: "return_point_store" }));
        return;
      }
      this.$router.push(this.fun.getUrl("orderlist", { status: 0, orderType: "return_point" }));
    }
  }
};
</script>
<style lang="scss" scoped>
.return_point_supplier {
  .pos {
    position: fixed;
    width: 100%;
    bottom: 0;
    left: 0;
    background: #ffffff;
    .btn {
      margin: 0.63rem 0.75rem;
      text-align: center;
      font-weight: 500;
      font-size: 0.94rem;
      line-height: 1;
      background: #f15353;
      border-radius: 1.28rem;
      color: #ffffff;
      padding: 0.75rem 0;
      box-sizing: border-box;
    }
  }
  .gridBox {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 0.63rem 0.75rem;
    background: #ffffff;
    border-radius: 0.5rem;
    .gridBox-item {
      padding: 1rem 0;
      flex: 1;
      text-align: center;
      .iconfont {
        font-size: 1.3rem;
        font-weight: bold;
      }
      .icon-fontclass-daifshouhuo {
        font-size: 1.5rem;
      }
      .txt {
        font-size: 0.75rem;
        margin-top: 0.5rem;
      }
    }
  }
}
</style>
